#ifndef _ESP_H
#define _ESP_H
#define G_ESP extern

#define TRANS_LENTH_PER 128

#define AP_ACCOUNT "zj"
#define AP_PASS "1234567890"

#define ESP_AT_RES_OK "OK\r\n"
#define ESP_AT_RES_CONNECT "CONNECT\r\n\r\nOK\r\n"//"CONNECT\r\nOK"
#define ESP_AT_RES_JION_AP_OK "WIFI CONNECTED\r\nWIFI GOT IP\r\n"
#define ESP_AT_RES_CONNECTED "CONNECTED\r\n"

#define ESP_AT_UART_TEST "AT"


#define ESP_AT_WIFI_MODE_STA "AT+CWMODE=1"
#define ESP_AT_WIFI_MODE_AP "AT+CWMODE=2"
#define ESP_AT_WIFI_JOIN_AP "AT+CWJAP_DEF="//AT+CWJAP_DEF="zj","1234567890"
#define ESP_AT_WIFI_CONNECT_SERVER  "AT+CIPSTART="//AT+CIPSTART="TCP","10.10.19.41",60002
#define ESP_AT_WIFI_SEND  "AT+CIPSEND="//AT+CIPSEND=10
#define ESP_AT_WIFI_CONNECT_IP "10.10.19.206"//206  41
#define ESP_AT_WIFI_CONNECT_MODE "TCP"
#define ESP_AT_WIFI_CONNECT_PORT 60002


G_ESP u8 esp_recv[128];
G_ESP u8 esp_recv_flag;

G_ESP int8_t esp_init(void);
G_ESP int8_t esp_send_data(u8 *str,u32 len);
G_ESP u32 esp_recv_data(u8 *str);
#endif
